import store from "@/store";
import axios from "axios";

const instance=axios.create({
    baseURL:'http://sell.h5.itsource.cn:8087',
    timeout:30000
})
// 请求拦截
instance.interceptors.request.use(config=>{
    let token = store.state.user.token
    token&&(config.headers.Authorization=token)
    return config
},err=>{
    return new Promise.reject(err)
})
// 响应拦截
instance.interceptors.response.use(response=>{
    return response
},err=>{
    return new Promise.reject(err)
})

export default instance